<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        * {margin: 0;padding: 0}
    </style>
</head>
<body>
    <div id="app">
        <button @click="show=!show" ref="btn">switch</button>
        <v-damu ref="damu"></v-damu>
    </div>
</body>
<script src="../../js/vue.js"></script>
<script>
    Vue.config.productionTip=false;
    new Vue({
        el:"#app",
        components:{
            "v-damu":{
                template:`<strong ref="rh">戏子入画;一生天涯</strong>`,
                mounted(){
                    console.log(this.$refs.rh)
                }
            }
        },
        mounted(){
            //console.log(this.$refs.btn) //拿到对应的dom节点
            //console.log(this.$refs.damu)//拿到对应的组件实例
        }
    })
</script>
</html>